import requests

from lxml import etree

url = "https://game.xiaomi.com/rank"

headers = {
    'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1 Edg/131.0.0.0'
}

response = requests.get(url, headers=headers)
data = response.content.decode()

# 解析数据
tree = etree.HTML(data)

# 提取数据
data = tree.xpath("//span[@class='about-name']/text()")
print(data)
